from xkw_UI_auto.BasePages.basePage import BasePage
from xkw_UI_auto.LocatorEelements.bk_locator.login_locator import LoginLocator as loc


class LoginPage(BasePage):

    # 登录功能
    def login(self, username, password):
        doc = "备课项目_登录页面_登录功能"
        self.switch_to_iframe(loc.frame_id)
        self.input_text(loc.user_input, username, doc=doc)
        self.input_text(loc.password_input, password, doc=doc)
        self.click_element(loc.login_button, doc=doc)

    # 切换到微信页面
    def switch_to_wx(self):
        doc = "备课项目_登录页面_切换到微信登录"
        self.switch_to_iframe(loc.frame_id)
        self.click_element(loc.wx_button, doc=doc)

    # 点击忘记密码
    def reset_password(self):
        doc = "备课项目_登录页面_点击忘记密码"
        self.switch_to_iframe(loc.frame_id)
        self.click_element(loc.forgetPwd, doc=doc)

    # 点击注册功能
    def reg(self):
        doc = "备课项目_登录页面_点击注册功能"
        self.switch_to_iframe(loc.frame_id)
        self.click_element(loc.reg_button, doc=doc)







